#include "Reactor.hpp"
#include "Listener.hpp"

int main(int argc, char* argv[])
{
    if (argc != 2)
    {
        std::cout << "Usage: " << argv[0] << " port" << std::endl;
        return 1;
    }
    ENABLE_CONSOLE_LOG();
    uint16_t local_port = std::stoi(argv[1]);

    Reactor reactor;
    std::shared_ptr<Connection> listener = std::make_shared<Listener>(local_port);
    reactor.InsertConnection(listener);   
    reactor.Loop();
    return 0;
}